import 'package:website.core/core/domain/config/environment.dart';

class Config {
  factory Config() {
    return _instance;
  }

  Config._internal();

  static final _instance = Config._internal();

  final termsOfUseUrl = 'https://angrywords.ru/terms';
  final privacyPolicyUrl = 'https://angrywords.ru/privacy';
  final appStoreAppUrl = 'https://apps.apple.com/ru/app/id1507234956';
  final googlePlayAppUrl =
      'https://play.google.com/store/apps/details?id=com.meowofficial.words&hl=ru';

  String get userManualUrl {
    return '$websiteBaseUrl/files/user_manual.pdf';
  }

  final supportEmail = 'support@angrywords.ru';
  final telegramChannelWelcomeMessageUrl =
      'https://t.me/angrywordsapp/10';

  final companyInn = '5904406050';
  final companyOgrn = '1235900008794';

  final _apiVersion = 'v1';

  late final Environment environment;

  late final String websiteBaseUrl;
  late final String apiBaseUrl;

  Future<void> initDev() async {
    environment = Environment.dev;

    websiteBaseUrl = 'http://localhost:8000';
    apiBaseUrl = 'http://localhost:9000/$_apiVersion';
  }

  Future<void> initStage() async {
    environment = Environment.stage;

    websiteBaseUrl = 'https://stage.angrywords.ru';
    apiBaseUrl = '$websiteBaseUrl/api/$_apiVersion';
  }

  Future<void> initProd() async {
    environment = Environment.prod;

    websiteBaseUrl = 'https://angrywords.ru';
    apiBaseUrl = '$websiteBaseUrl/api/$_apiVersion';
  }
}
